package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 成绩记录表
 * @TableName grade_record
 */
@TableName(value ="grade_record")
@Data
public class GradeRecord {
    /**
     * 记录ID
     */
    @TableId(type = IdType.AUTO)
    private Long recordId;

    /**
     * 学生ID
     */
    private Long studentId;

    /**
     * 课程ID
     */
    private Long courseId;

    /**
     * 考试ID
     */
    private Long examId;

    /**
     * 平时成绩
     */
    private BigDecimal dailyGrade;

    /**
     * 期中成绩
     */
    private BigDecimal midtermGrade;

    /**
     * 期末成绩
     */
    private BigDecimal finalGrade;

    /**
     * 总评成绩
     */
    private BigDecimal totalGrade;

    /**
     * 平时成绩权重(%)
     */
    private Integer dailyWeight;

    /**
     * 期中成绩权重(%)
     */
    private Integer midtermWeight;

    /**
     * 期末成绩权重(%)
     */
    private Integer finalWeight;

    /**
     * 成绩状态
     */
    private Object gradeStatus;

    /**
     * 录入教师ID
     */
    private Long inputTeacher;

    /**
     * 审核状态
     */
    private Object reviewStatus;

    /**
     * 审核教师ID
     */
    private Long reviewTeacher;

    /**
     * 审核时间
     */
    private Date reviewTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GradeRecord other = (GradeRecord) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            && (this.getCourseId() == null ? other.getCourseId() == null : this.getCourseId().equals(other.getCourseId()))
            && (this.getExamId() == null ? other.getExamId() == null : this.getExamId().equals(other.getExamId()))
            && (this.getDailyGrade() == null ? other.getDailyGrade() == null : this.getDailyGrade().equals(other.getDailyGrade()))
            && (this.getMidtermGrade() == null ? other.getMidtermGrade() == null : this.getMidtermGrade().equals(other.getMidtermGrade()))
            && (this.getFinalGrade() == null ? other.getFinalGrade() == null : this.getFinalGrade().equals(other.getFinalGrade()))
            && (this.getTotalGrade() == null ? other.getTotalGrade() == null : this.getTotalGrade().equals(other.getTotalGrade()))
            && (this.getDailyWeight() == null ? other.getDailyWeight() == null : this.getDailyWeight().equals(other.getDailyWeight()))
            && (this.getMidtermWeight() == null ? other.getMidtermWeight() == null : this.getMidtermWeight().equals(other.getMidtermWeight()))
            && (this.getFinalWeight() == null ? other.getFinalWeight() == null : this.getFinalWeight().equals(other.getFinalWeight()))
            && (this.getGradeStatus() == null ? other.getGradeStatus() == null : this.getGradeStatus().equals(other.getGradeStatus()))
            && (this.getInputTeacher() == null ? other.getInputTeacher() == null : this.getInputTeacher().equals(other.getInputTeacher()))
            && (this.getReviewStatus() == null ? other.getReviewStatus() == null : this.getReviewStatus().equals(other.getReviewStatus()))
            && (this.getReviewTeacher() == null ? other.getReviewTeacher() == null : this.getReviewTeacher().equals(other.getReviewTeacher()))
            && (this.getReviewTime() == null ? other.getReviewTime() == null : this.getReviewTime().equals(other.getReviewTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getCourseId() == null) ? 0 : getCourseId().hashCode());
        result = prime * result + ((getExamId() == null) ? 0 : getExamId().hashCode());
        result = prime * result + ((getDailyGrade() == null) ? 0 : getDailyGrade().hashCode());
        result = prime * result + ((getMidtermGrade() == null) ? 0 : getMidtermGrade().hashCode());
        result = prime * result + ((getFinalGrade() == null) ? 0 : getFinalGrade().hashCode());
        result = prime * result + ((getTotalGrade() == null) ? 0 : getTotalGrade().hashCode());
        result = prime * result + ((getDailyWeight() == null) ? 0 : getDailyWeight().hashCode());
        result = prime * result + ((getMidtermWeight() == null) ? 0 : getMidtermWeight().hashCode());
        result = prime * result + ((getFinalWeight() == null) ? 0 : getFinalWeight().hashCode());
        result = prime * result + ((getGradeStatus() == null) ? 0 : getGradeStatus().hashCode());
        result = prime * result + ((getInputTeacher() == null) ? 0 : getInputTeacher().hashCode());
        result = prime * result + ((getReviewStatus() == null) ? 0 : getReviewStatus().hashCode());
        result = prime * result + ((getReviewTeacher() == null) ? 0 : getReviewTeacher().hashCode());
        result = prime * result + ((getReviewTime() == null) ? 0 : getReviewTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", studentId=").append(studentId);
        sb.append(", courseId=").append(courseId);
        sb.append(", examId=").append(examId);
        sb.append(", dailyGrade=").append(dailyGrade);
        sb.append(", midtermGrade=").append(midtermGrade);
        sb.append(", finalGrade=").append(finalGrade);
        sb.append(", totalGrade=").append(totalGrade);
        sb.append(", dailyWeight=").append(dailyWeight);
        sb.append(", midtermWeight=").append(midtermWeight);
        sb.append(", finalWeight=").append(finalWeight);
        sb.append(", gradeStatus=").append(gradeStatus);
        sb.append(", inputTeacher=").append(inputTeacher);
        sb.append(", reviewStatus=").append(reviewStatus);
        sb.append(", reviewTeacher=").append(reviewTeacher);
        sb.append(", reviewTime=").append(reviewTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}